import java.util.Scanner;
public class shui_xian_hua {
    public static boolean shui_xian_hua(int num){
        int bai,shi,ge;
        bai = num / 100;
        shi = num % 100 / 10;
        ge = num % 10;
        if (Math.pow(bai,3)+Math.pow(shi,3)+Math.pow(ge,3)==num){
            return true;
        }
        return false;
    }
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个三位数：");
        int num1 = scanner.nextInt();
        if (shui_xian_hua(num1)){
            System.out.println(num1+"是一个水仙花数");
        }
        else{
            System.out.println(num1+"不是一个水仙花数");
        }
        /**
        for (int i=100;i<1000;i++){
            if (shui_xian_hua(i)){
                System.out.println(i+"是一个水仙花数");
            }
        }

         */
    }
}
